{
capture drop sample
gen sample=(n_ud==1 & S_pds==1)

label var S_sourcing "\$Relational_b\$" 

eststo clear
eststo: reghdfe ln_p_sbjo S_sourcing   ///
if sample==1, ///
abs(gr_sjt ) vce (cluster b_id)
  quietly estadd local CTRL =".", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjt", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace   

eststo: reghdfe ln_p_sbjo   S_sourcing  ln_q_b_all age_buy_month signatory  ///
if sample==1, ///
abs(gr_sjt top_dest_b cohort_b) vce (cluster b_id)
  quietly estadd local CTRL ="\footnotesize{B}", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjt,d", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace   

eststo: reghdfe ln_p_sbjo  S_sourcing  ln_q_sb_all sh_s_b sh_b_s age_buysel_month signatory  ///
 ln_q_b_all age_buy_month ///
if sample==1, ///
abs(gr_sjt top_dest_b cohort_sb cohort_b) vce (cluster b_id)
  quietly estadd local CTRL ="\footnotesize{B,R}", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjt,d", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace 

eststo: reghdfe ln_p_sbjo  S_sourcing  ln_q_sb_all sh_s_b sh_b_s age_buysel_month signatory  ///
 ln_q_b_all age_buy_month ln_p_inpf_sbjo ln_q_sbjo ///
if sample==1, ///
abs(gr_sjt top_dest_b cohort_sb cohort_b) vce (cluster b_id)
  quietly estadd local CTRL ="\footnotesize{B,R,O}", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjt,d", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace 
  
esttab using "${tables}\Table3.tex", ///
  label replace booktabs b(3) se(3) noconstant obslast substitute(\_ _) ///
  title("Buyers' Sourcing and Prices" \label{Prices}) ///
  drop(ln_q_b_all ln_q_sb_all sh_s_b sh_b_s  ln_q_b_all age_buy_months age_buysel_months ln_p_inpf_sbjo ln_q_sbjo signatory _cons) order( ) /// 
  stats(FE CTRL r2   N   , fmt( %~#s  %~#s 2 %12.0fc  )  ///
  labels("FEs" "Controls" `"\(R^{2}\)"'  "Obs."  ))   ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  nonotes  	
}
